const promiseA = new Promise((resolve, reject) => {
  console.log("1");
  resolve("4");
});
const promiseB = promiseA.then((res) => {
  console.log(res);
  
});
console.log("2", promiseA);
console.log("3", promiseB);

/**
 1
2 Promise { '4' }
3 Promise { <pending> }
4
 */